Garbage collection of nuisance cookies

ABSTRACT

The disclosure is directed to garbage cleaning of cookies in a web browser. A computer-implemented process according to embodiments includes: determining a presence of a first cookie and a second cookie in the web browser, the first cookie and the second cookie representing a cleanliness status of the web browser; in response to determining that the first cookie and the second cookie are both present in the web browser, indicating a status of the web browser as clean and taking no further cleaning action; and in response to determining that only the first cookie is present in the web browser, indicating the status of the web browser as needs cleaning, and performing garbage collection of cookies in the web browser.

TECHNICAL FIELD

The present invention relates generally to web browsers, and moreparticularly, to a method, system, and computer program product for thegarbage collection of nuisance cookies in a web browser.

BACKGROUND

Many independent application operators within a single domain, e.g.“example.com,” are able to choose session cookie settings, makingdecisions independently for what is best for their application. In theaggregate these decisions sometimes have detrimental effects. Forinstance, application operators would prefer to have cookies that arepersistent and have very wide scopes to ensure the most coverage. Inlarge organization these cookies may accumulate over time leading to anoverflow of input buffers on web servers.

SUMMARY

A first aspect of the invention provides a computer-implemented processfor garbage cleaning of cookies in a web browser, including: determininga presence of a first cookie and a second cookie in a web browser, thefirst cookie and the second cookie representing a cleanliness status ofthe web browser; in response to determining that the first cookie andthe second cookie are both present in the web browser, indicating astatus of the web browser as clean and taking no further cleaningaction; and in response to determining that only the first cookie ispresent in the web browser, indicating the status of the web browser asneeds cleaning, and performing garbage collection of cookies in the webbrowser.

A second aspect of the invention provides a computerized system forperforming a method for garbage cleaning of cookies in a web browser,the method including: determining a presence of a first cookie and asecond cookie in the web browser, the first cookie and the second cookierepresenting a cleanliness status of the web browser; in response todetermining that the first cookie and the second cookie are both presentin the web browser, indicating a status of the web browser as clean andtaking no further cleaning action; and in response to determining thatonly the first cookie is present in the web browser, indicating thestatus of the web browser as needs cleaning, and performing garbagecollection of cookies in the web browser.

A third aspect of the invention provides a computer program productstored on a computer readable storage medium, which when executed by acomputer system, performs a method for garbage cleaning of cookies in aweb browser, the method including: determining a presence of a firstcookie and a second cookie in a web browser, the first cookie and thesecond cookie representing a cleanliness status of the web browser; inresponse to determining that the first cookie and the second cookie areboth present in the web browser, indicating a status of the web browseras clean and taking no further cleaning action; and in response todetermining that only the first cookie is present in the web browser,indicating the status of the web browser as needs cleaning, andperforming garbage collection of cookies in the web browser. Anotheraspect of the invention provides a method, including: determining arespective status of each of a first cookie and a second cookie in theweb browser, the statuses of the first cookie and the second cookiecorresponding to a cleanliness status of the web browser; and inresponse to determining that only the status of the first cookie isvalid, indicating the status of the web browser as needs cleaning, andperforming garbage collection of cookies in the web browser.

Other aspects of the invention provide methods, systems, programproducts, and methods of using and generating each, which include and/orimplement some or all of the actions described herein. The illustrativeaspects of the invention are designed to solve one or more of theproblems herein described and/or one or more other problems notdiscussed.

BRIEF DESCRIPTION OF THE DRAWINGS

These and other features of the disclosure will be more readilyunderstood from the following detailed description taken in conjunctionwith the accompanying drawings that depict various aspects of theinvention.

FIG. 1 depicts a client/server system providing garbage collection ofnuisance cookies according to embodiments.

FIG. 2 depicts a process for providing garbage collection of nuisancecookies according to embodiments.

FIG. 3 depicts the garbage collection module of FIG. 1 in greater detailaccording to embodiments.

FIG. 4 depicts a processing system for providing garbage collection ofnuisance cookies according to embodiments.

The drawings are not necessarily to scale. The drawings are merelyschematic representations, not intended to portray specific parametersof the invention. The drawings are intended to depict only typicalembodiments of the invention, and therefore should not be considered aslimiting the scope of the invention. In the drawings, like numberingrepresents like elements.

DETAILED DESCRIPTION

The present invention relates generally to web browsers, and moreparticularly, to a method, system, and computer program product for thegarbage collection of nuisance cookies in a web browser.

According to embodiments, garbage collection of cookies is performed ina web browser within a managed domain space using a defined overarchingpolicy. A scheduling mechanism in the web browser is provided fordeferred and periodic execution of actions such as proactive cleaning ofnon-essential or otherwise nuisance cookies. In general, there isprovided a signal management module, which executes in either aclient/browser or server context, for maintaining the proper status ofsignal cookies, and a cleaning module, which executes in a client ineither a client/browser or server context, for performing garbagecollection functions. The cleaning module, when executed on theclient/browser context, may execute inline actions or downloadedactions.

FIG. 1 depicts a client/server system 10 providing garbage collection ofnuisance cookies according to embodiments. The client/server system 10includes at least one client device (client 12) connected to a server 14(e.g., web server) through a network 16.

The client 12 can be any type of device, such as a computer, mobilephone, etc., capable of supporting a web browser 18. The server 14stores, processes, and delivers web pages to the client 12. The network16 can be a wired and/or wireless network, such as a local area network(LAN) or a wide area network (WAN), including an extranet, the Internet,and/or the like. The client/server system 10 may include at least one ofa client-side garbage collection module 20 on the client 12 and aserver-side garbage collection module 22 on the server 14. Thefunctionality of the client-side garbage collection module 20 and theserver-side garbage collection module 22 will be described in greaterdetail below.

According to embodiments, two different cookies (i.e., a short termcookie 30 and a long term cookie 32) are set on the web browser 18,representing Boolean values with opposing meanings, and different timeperiods, to indicate the cleanliness status of the web browser 18. Theshort and long term cookies 30, 32 expire (i.e., are no longer set) atthe expiration of their respective time periods.

The web browser 18 is considered “clean” and a participant in thegarbage collection scheme as long as both the short term cookie 30 andthe long term cookie 32 remain set, and no further action (e.g., nogarbage collection) is required. When set, the long term cookie 32indicates a “needs cleaning” status. When set, the short term cookie 30indicates a “clean” status. The expiration (and resulting absence) ofthe short term cookie 30 causes a prescribed action (garbage collection)to commence. The end of the prescribed action causes the setting of anew short term cookie 30 and resetting of the time period of the longterm cookie 32 for continued participation in the garage collectionscheme. With this arrangement, the absence of the long term cookie 32indicates a non-participation in the garbage collection scheme, whichtriggers the setting of both of the short term cookie 30 and the longterm cookie 32 as an initial status.

A flow diagram of the evaluation process of the short term cookie 30 andthe long term cookie 32 according to embodiments is depicted in FIG. 2.It is assumed for sake of description that the short term cookie 30 andthe long term cookie 32 are initially set.

At P1, the short and long term cookies 30, 32 are evaluated (e.g.,periodically or continually) to determine their status. If both of theshort and long term cookies 30, 32 are valid (e.g., not expired) (YES,P1), the evaluation of the short and long term cookies 30, 32 at P1 isrepeated. Otherwise (NO, P1), flow passes to P2.

If the long term cookie 32 is not set (NO, P2), the short term cookie 30and the long term cookie 32 are set to an initial status at P3. Flowthen passes back to P1. If the long term cookie 32 is set (YES, P2), theshort term cookie 30 is evaluated at P1 flow passes to P5.

Garbage collection is performed at P5 to remove a set of cookies (e.g.,nuisance cookies). Upon completion of the garbage collection (YES, P6),a new short term cookie 30 is set and the time period of the long termcookie 32 is reset at P7. Flow then passes back to P1.

According to embodiments, a short term cookie 30 and a long term cookie32 are set on the web browser 18 to indicate the cleanliness status ofthe web browser 18. The short and long term cookies 30, 32 expire (i.e.,are no longer set) at the expiration of their respective time periods.In an illustrative implementation, the short term cookie 30 is set at afirst duration (e.g., 24 hours) as a Boolean value (e.g., I_AM_CLEAN=1domain=*.ibm.com path=/expire=tomorrow). The long term cookie 32 is setto a second, longer duration (e.g., 365 days) as a Boolean value thatacts as a pointer to the code to be executed (e.g.,I_NEED_CLEANING=“http://www.example.com/cleanme” domain=*.ibm.com path=/expire=“next year”). Any suitable time durations may be used, so long asthe long term cookie 32 is set to a longer time duration than the shortterm cookie 32.

An action table for the Boolean values of the short and long termcookies 30, 32 is presented in the TABLE A, where:

-   short term cookie 30→I_AM_CLEAN; and-   long term cookie 32→I_NEED_CLEANING.

TABLE A I_AM_CLEAN I_AM_CLEAN (Present) (Absent) I_NEED_CLEANING(Present) No Operation Perform Cleaning I_NEED_CLEANING (Absent)setCookie setCookie I_NEED_CLEANING I_NEED_CLEANING I_AM_CLEAN

Referring now to FIG. 3, the garbage collection module 20 on the client12 and the server-side garbage collection module 22 on the server 14 mayeach include a signal management module 40 and a cleaning module 42. Thepurpose of the modules 40, 42 is described below.

Signal Management Module

The signal management module 40 may be activated in the web browser 18by referencing a specific program/script (e.g., via a theme of awebsite). For example, a beacon present in the masthead or footer when aweb page is loaded may be used to activate the signal management module40, which may be executed in either a client/browser execution contextor a server execution context.

In the case of a server execution context (see, e.g., pseudo-codeexemplar below), the evaluation of the short and long term cookies 30,32 and resulting “Set-Cookie” or “Location” HTTP headers is performed aspart of the server-side beacon processing logic. The results of signalprocessing include:

-   a) redirection to load a transparent image/object;-   b) the generation of a Set-Cookie header for a long term cookie 32    along with the redirection of the transparent image/object;-   c) the redirection to a server-side program/script that performs the    cleaning actions; or d) the generation of Set-Cookie headers for    both a long term cookie 32 and a short term cookie 30 along with the    redirection of the transparent image/object. This method may be    performed whenever inspection of the processing would be    undesirable.

Exemplar for Server Execution Context with Inline Cleaning Module

cookies=parseCookies(request); if cookie(I_AM_CLEAN) EXISTSIN cookies; { if cookie(I_NEED_CLEANING) EXISTSIN cookies {   : # no op  }  else {  response=response + makeResponseHeader(setCookie   (I_NEED_CLEANING,*.example.com, /, 365 days));   }  else {   if cookie(I_NEED_CLEANING)EXISTSIN cookies; {    foreach thisCookie in cookies; {    response=response + makeResponseHeader(setCookie    (thisCookie,*.example.org, /, yesterday);    }   response=response + setCookie(I_AM_CLEAN, *.example.com, /,  tomorrow)    response=response setCookie(I_NEED_CLEANING,   *.example.com, /, 365 days)   }   else { # Neither exists   response=response + setCookie(I_AM_CLEAN, *.example.com, /,  tomorrow)    response=response + setCookie(I_NEED_CLEANING,   *.example.com, /, 365 days)  }  response=response +makeResponse(redirect(http://www.example.org/  image.gif)); sendResponse(response);

In the case of browser/client execution context (see, e.g., pseudo-codeexemplars below), the evaluation of the short and long term cookies 30,32 and triggering of the resulting action is performed on the webbrowser 18 via a downloaded program/script (e.g., downloaded from theserver 14). The resulting action may execute in either a client/browseror server context. The results of signal processing may include:

-   a) no action;-   b) the local setting of a long term cookie 32;-   c) the execution of local code that performs the cleaning actions    along with the setting of both long and short term cookies 30, 32;    or-   d) the generation of both long and short term cookies 30, 32. This    method may be performed whenever performance is at a premium.

Exemplar of Browser/Client Execution Context with Server Actions (pseudocode to be run in web browser each time a web page is loaded)

cleaning_module_URL=“https://www.example.org/cookie_cleaner.jsp” ifcookie(I_AM_CLEAN); {  if cookie(I_NEED_CLEANING) {   : #no op  }  else{   setCookie(I_NEED_CLEANING, *.example.com, /, 365 days)  } else {  ifcookie(I_NEED_CLEANING); {   getURL(cleaning_module_URL)  setCookie(I_AM_CLEAN, *.example.com, /, tomorrow)  setCookie(I_NEED_CLEANING, *.example.com, /, 365 days)  }  else { #Neither cookie exists   setCookie(I_AM_CLEAN, *.example.com, /,tomorrow)   setCookie(I_NEED_CLEANING, *.example.com, /, 365 days) }

Exemplar of Browser/Client Execution Context with Cleaning ActionsConsulting a Data Store (pseudo code to be run in web browser each timea web page is loaded)

good_cookies=“http://www.example.org/good_cookies.json”bad_cookies=“http://www.example.org/bad_cookies.json” If EXISTScookie(I_AM_CLEAN); {  if cookie(I_NEED_CLEANING) {   : #no op  }  else{   setCookie(I_NEED_CLEANING, *.ibm.com, /, 365 days)  } else {  ifcookie(I_NEED_CLEANING); {   vital_cookies=getJSON(good_cookies)  problem_cookies=getJSON(bad_cookies)   foreach cookie ingetLocalCookies; {    if cookie NOTEXISTSIN vital_cookies ;{expire(cookie) }    if cookie EXISTSIN problem_cookies ;{expire(cookie) }   }   setCookie(I_AM_CLEAN, *.ibm.com, /, tomorrow)  setCookie(I_NEED_CLEANING, *.ibm.com, /, 365 days)  }  else { #Neither cookie exists   setCookie(I_AM_CLEAN, *.ibm.com, /, tomorrow)  setCookie(I_NEED_CLEANING, *.ibm.com, /, 365 days)  }

Cleaning Module

The cleaning module 42 is activated by the signal management module 40.The cleaning module 42 can execute in either the client/browser contextor the server context. The cleaning module 42 performs the requiredgarbage collection actions to achieve the desired (clean) status, andsets a short term cookie 30 indicating the clean status as its lastaction. The cleaning module 42 may clear all the cookies that arepresent, or consult a data store to only clean those cookies that arepresent in the data store (e.g., bad cookies). Conversely, theconsultation may be such as to clean all cookies except those that arepresent in the data store (good cookies).

Cleaning JavaScript Code Run Secondary to User Action

// mini-jQuery - CRUD COOKIES var $ = function (id) { returndocument.getElementById(id); }; // Cache $set = $(‘set’); $read =$(‘read’); $delete = $(‘delete’); $logs = $(‘logs’); // Logs in textareavar log = function (log) { $logs.value = log + ‘\n’ + $logs.value; } //Create Cookie var createCookie = function (key, value) {  expires = newDate( );  expires.setTime(expires.getTime( ) + 31536000000);  cookie =key + “=” + value + “;expires=” + expires.toUTCString( ); log(“createCookie: ” + cookie);  return document.cookie = cookie; } //Read Cookie var readCookie = function (key) {  keyValue =document.cookie.match(“({circumflex over ( )}|;) ?” + key +“=([{circumflex over ( )};]*)(;|$)”);  if (key Value) {  log(“readCookie: ” + key + “=” + keyValue[2]);   return keyValue[2]; } else {   log(“getCookie: ” + key + “=” + “null”);   return null; } }// Destroy Cookie var destroyCookie = function (key) { log(“destroyCookie: ” + key);  return document.cookie = key +‘=;expires=Thu, 01 Jan 1970  00:00:01 GMT;’; } // Buttons for Demo$set.onclick = function ( ) {  key = $(‘key’).value;  value =$(‘value’).value;  createCookie(key, value); } $read.onclick = function( ) {  key = $(‘key-read’).value;  readCookie(key); } $delete.onclick =function ( ) {  key = $(‘key-delete’).value;  destroyCookie(key); } //Search clenan for hostname (function ( ) {  var cookies =document.cookie.split(“; ”);  for (var c = 0; c < cookies.length; c++) {  var d = window.location.hostname.split(“.”);  while (d.length > 0) {  var cookieBase = encodeURIComponent(cookies[c].split(“;”)[0].split(“=”)[0]) +   ‘=;expires=Thu, 01-Jan-1970 00:00:01 GMT; domain=’ +   d.join(‘.’) + ‘ ;path=’;  var p = location.pathname.split(‘/’);  document.cookie =cookieBase + ‘/’;  while (p.length > 0) {   document. cookie =cookieBase + p.join(‘/’);   p.pop( )  };  d. shift( );  } } })( );

The present invention may be a system, a method, and/or a computerprogram product. The computer program product may include a computerreadable storage medium (or media) having computer readable programinstructions thereon for causing a processor to carry out aspects of thepresent invention.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firewalls, switches, gateway computers and/oredge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present invention may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, or either source code or object code written in anycombination of one or more programming languages, including an objectoriented programming language such as Smalltalk, C++ or the like, andconventional procedural programming languages, such as the “C”programming language or similar programming languages. The computerreadable program instructions may execute entirely on the user'scomputer, partly on the user's computer, as a stand-alone softwarepackage, partly on the user's computer and partly on a remote computeror entirely on the remote computer or server. In the latter scenario,the remote computer may be connected to the user's computer through anytype of network, including a local area network (LAN) or a wide areanetwork (WAN), or the connection may be made to an external computer(for example, through the Internet using an Internet Service Provider).In some embodiments, electronic circuitry including, for example,programmable logic circuitry, field-programmable gate arrays (FPGA), orprogrammable logic arrays (PLA) may execute the computer readableprogram instructions by utilizing state information of the computerreadable program instructions to personalize the electronic circuitry,in order to perform aspects of the present invention.

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that can directa computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture including instructions which implement aspects ofthe function/act specified in the flowchart and/or block diagram blockor blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof instructions, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the block may occur out of theorder noted in the figures. For example, two blocks shown in successionmay, in fact, be executed substantially concurrently, or the blocks maysometimes be executed in the reverse order, depending upon thefunctionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustration, and combinations of blocksin the block diagrams and/or flowchart illustration, can be implementedby special purpose hardware-based systems that perform the specifiedfunctions or acts or carry out combinations of special purpose hardwareand computer instructions.

While it is understood that the program product of the present inventionmay be manually loaded directly in a computer system via a storagemedium such as a CD, DVD, etc., the program product may also beautomatically or semi-automatically deployed into a computer system bysending the program product to a central server or a group of centralservers. The program product may then be downloaded into clientcomputers that will execute the program product. Alternatively theprogram product may be sent directly to a client system via e-mail. Theprogram product may then either be detached to a directory or loadedinto a directory by a button on the e-mail that executes a program thatdetaches the program product into a directory. Another alternative is tosend the program product directly to a directory on a client computerhard drive.

FIG. 4 depicts an illustrative processing system 100 (e.g., within amobile device) for implementing various aspects of the presentinvention, according to embodiments. The processing system 100 maycomprise any type of computing device and, and for example includes atleast one processor, memory, an input/output (I/O) (e.g., one or moreI/Ointerfaces and/or devices), and a communications pathway. In general,processor(s) execute program code, which is at least partially fixed inmemory. While executing program code, processor(s) can process data,which can result in reading and/or writing transformed data from/tomemory and/or I/O for further processing. The pathway provides acommunications link between each of the components in processing system100. I/O can comprise one or more human I/O devices, which enable a userto interact with processing system 100.

The foregoing description of various aspects of the invention has beenpresented for purposes of illustration and description. It is notintended to be exhaustive or to limit the invention to the precise formdisclosed, and obviously, many modifications and variations arepossible. Such modifications and variations that may be apparent to anindividual skilled in the art are included within the scope of theinvention as defined by the accompanying claims.

What is claimed is:
 1. A computer-implemented process for garbagecollection of cookies in a web browser, comprising: determining arespective status of each of a first cookie and a second cookie in theweb browser, the statuses of the first cookie and the second cookiecorresponding to a cleanliness status of the web browser; and inresponse to determining that only the status of the first cookie isvalid, indicating the status of the web browser as needs cleaning, andperforming garbage collection of cookies in the web browser.
 2. Thecomputer-implemented process according to claim 1, wherein the firstcookie is a long term cookie having a first validity period, and whereinthe second cookie is a short term cookie having a second validity periodshorter than the first validity period of the long term cookie.
 3. Thecomputer-implemented process according to claim 2, further comprising,prior to determining the statuses of the first and second cookies:setting the second validity period of the short term cookie; setting theshort term cookie to a first Boolean value; setting the first validityperiod of the long term cookie; and setting the long term cookie to asecond Boolean value, different than the first Boolean value.
 4. Thecomputer-implemented process according to claim 3, wherein the secondBoolean value comprises a pointer to a computer program product, whichwhen executed, performs the garbage collection of cookies in the webbrowser.
 5. The computer-implemented process according to claim 2,further comprising: in response to determining that the status of thelong term cookie is not valid, setting the short term and long termcookies.
 6. The computer-implemented process according to claim 2,further comprising: in response to completion of the garbage collectionof cookies in the web browser, setting the short term and long termcookies.
 7. A computerized system for garbage collection of cookies in aweb browser by performing a method, the method comprising: determining arespective status of each of a first cookie and a second cookie in theweb browser, the statuses of the first cookie and the second cookiecorresponding to a cleanliness status of the web browser; and inresponse to determining that only the status of the first cookie isvalid, indicating the status of the web browser as needs cleaning, andperforming garbage collection of cookies in the web browser.
 8. Thecomputerized system according to claim 7, wherein the first cookie is along term cookie having a first validity period, and wherein the secondcookie is a short term cookie having a second validity period shorterthan the first validity period of the long term cookie.
 9. Thecomputerized system according to claim 8, the method further comprising,prior to determining the statuses of the first and second cookies:setting the second validity period of the short term cookie; setting theshort term cookie to a first Boolean value; setting the first validityperiod of the long term cookie; and setting the long term cookie to asecond Boolean value, different than the first Boolean value.
 10. Thecomputerized system according to claim 9, wherein the second Booleanvalue comprises a pointer to a computer program product, which whenexecuted, performs the garbage collection of cookies in the web browser.11. The computerized system according to claim 8, the method furthercomprising: in response to determining that the status of the long termcookie is not valid, setting the short term and long term cookies. 12.The computerized system according to claim 8, the method furthercomprising: in response to completion of the garbage collection ofcookies in the web browser, setting the short term and long termcookies.
 13. A computer program product comprising a computer readablestorage medium having program instructions embodied therewith, theprogram instructions executable by a computer system to cause thecomputer system to perform a method for garbage cleaning of cookies in aweb browser, the method including: determining a respective status ofeach of a first cookie and a second cookie in the web browser, thestatuses of the first cookie and the second cookie corresponding to acleanliness status of the web browser; and in response to determiningthat only the status of the first cookie is valid, indicating the statusof the web browser as needs cleaning, and performing garbage collectionof cookies in the web browser.
 14. The computer program productaccording to claim 13, wherein the first cookie is a long term cookiehaving a first validity period, and wherein the second cookie is a shortterm cookie having a second validity period shorter than the firstvalidity period of the long term cookie.
 15. The computer programproduct according to claim 14, further comprising, prior to determiningthe statuses of the first and second cookies: setting the secondvalidity period of the short term cookie; setting the short term cookieto a first Boolean value; setting the first validity period of the longterm cookie; and setting the long term cookie to a second Boolean value,different than the first Boolean value.
 16. The computer program productaccording to claim 15, wherein the second Boolean value comprises apointer to a computer program product, which when executed, performs thegarbage collection of cookies in the web browser.
 17. The computerprogram product according to claim 14, further comprising: in responseto determining that the status of the long term cookie is not valid,setting the short term and long term cookies.
 18. The computer programproduct according to claim 14, further comprising: in response tocompletion of the garbage collection of cookies in the web browser,setting the short term and long term cookies.